package com.zhouz.admin.app.db.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zhouz.admin.app.db.domain.enums.IsOrNotEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author 张鹏
 * @since 2018-11-20
 */
@Data
@ApiModel
@TableName("sys_opt_log")
public class OptLog {

    private static final long serialVersionUID = 1L;

    public OptLog(){}
	public OptLog(String urlDesc, int timeUse, String businessNo, IsOrNotEnum isOrNotEnum, String app){
    	this.urlDesc = urlDesc;
    	this.timeUse = timeUse;
    	this.businessNo = businessNo;
    	this.isException = isOrNotEnum.getValue();
    	this.app = app;
	}
    /**
     * id
     */
	@TableId(value="id", type= IdType.AUTO)
	@ApiModelProperty(required= false,value = "id")
	private Long id;
    /**
     * 请求号
     */
	@TableField("request_no")
	@ApiModelProperty(required= false,value = "请求号")
	private String requestNo;
    /**
     * 请求ip
     */
	@ApiModelProperty(required= false,value = "请求ip")
	private String ip;
    /**
     * 业务编号
     */
	@TableField("business_no")
	@ApiModelProperty(required= false,value = "业务编号")
	private String businessNo;
    /**
     * 请求地址
     */
	@ApiModelProperty(required= false,value = "请求地址")
	private String url;
    /**
     * 请求地址描述
     */
	@TableField("url_desc")
	@ApiModelProperty(required= false,value = "请求地址描述")
	private String urlDesc;
    /**
     * 请求耗时
     */
	@TableField("time_use")
	@ApiModelProperty(required= false,value = "请求耗时")
	private Integer timeUse;
    /**
     * 请求时间
     */
	@TableField(value = "create_time",fill = FieldFill.INSERT)
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm")
	@ApiModelProperty(required= false,value = "请求时间")
	private Date createTime;
    /**
     * 请求用户编码
     */
	@TableField("user_code")
	@ApiModelProperty(required= false,value = "请求用户编码")
	private String userCode;
    /**
     * 请求用户名称
     */
	@TableField("user_name")
	@ApiModelProperty(required= false,value = "请求用户名称")
	private String userName;
    /**
     * 是否有效,Y：是，N：否；IsOrNotEnum
     */
	@TableField("is_exception")
	@ApiModelProperty(required= false,value = "是否有效,Y：是，N：否；IsOrNotEnum")
	private String isException;

	private String app;


	public static final String ID = "id";

	public static final String REQUEST_NO = "request_no";

	public static final String IP = "ip";

	public static final String BUSINESS_NO = "business_no";

	public static final String URL = "url";

	public static final String URL_DESC = "url_desc";

	public static final String TIME_USE = "time_use";

	public static final String CREATE_TIME = "create_time";

	public static final String USER_CODE = "user_code";

	public static final String USER_NAME = "user_name";

	public static final String IS_EXCEPTION = "is_exception";
}
